import request from "@/utils/request";
import RequestMethod from "@/constant/RequestMethod";


export function adminLogin(data) {
    return request({
        url: '/api/admin/login',
        method: RequestMethod.POST,
        data
    })
}

export function adminUserInfo() {
    return request({
        url: '/api/admin/info',
        method: RequestMethod.GET
    })
}

export function businessLogin(data) {
    return request({
        url: '/api/businesses/login',
        method: RequestMethod.POST,
        data
    })
}

export function businessesRegistery(data) {
    return request({
        url: '/api/businesses/registery',
        method: RequestMethod.POST,
        data
    })
}

export function getCaptcha() {
    return request({
        url: '/api/common/getCaptcha',
        method: RequestMethod.GET,
    })
}

export function updateBusinessShelves(data) {
    return request({
        url: '/api/admin/updateBusinessShelves',
        method: RequestMethod.PUT,
        data
    })
}

export function userSelectBusinessGoods(id) {
    return request({
        url: '/api/admin/business/goods/list/' + id,
        method: RequestMethod.GET
    })
}

export function upDownGoods(goodsId, state) {
    return request({
        url: '/api/admin/change/business/goods',
        method: RequestMethod.PUT,
        data: {goodsId: goodsId, state: state}
    })
}